<?php
class DBOperate {
	private $link;
	function __construct() {
		$this->link = mysql_connect ( 'localhost', 'root', '1' ) or die ( 'connect error:' . mysql_errno ());
		mysql_select_db('eccg') or die('could not select database.');
	}
	function __destruct(){
		mysql_close();
	}
	function query($sql){
	 	$relult = mysql_query($sql,$this->link) or dir('query error.sql:'.$sql);
	 	return $relult;
	}
}
?>